package cn.bdqn.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Author: 苏闻君
 * @Date: Created in 2020/7/30  14:49
 * 积分接口
 */
@Mapper
public interface IntegralDaok {
    /**
     * 根据用户id查询积分
     * @return
     */
    @Select("SELECT scores FROM employees WHERE id=#{id}")
    Integer Selectjifen(Integer id);

    /**
     * 兑换商品扣除积分
     * @param id 员工id
     * @param des 积分描述
     * @return
     */
    @Insert("INSERT INTO `study`.`integral` VALUES ( NULL, #{id}, #{des}, NOW());")
    Integer insertjifen(Integer id,String des);


}
